package fxification.java;

import com.sun.javafx.functions.Function0;
import com.sun.javafx.functions.Function1;

/**
 * @author vvivien
 */
public interface TaskRunnerContext{
    public Function0<Void> getStartTaskCallback();
    public void setStartTaskCallback(final Function0<Void> onStart);

    public Function0<Void> getStopTaskCallback();
    public void setStopTaskCallback(final Function0<Void> onStopped);

    public Function0<Void> getTaskDoneCallback();
    public void setTaskDoneCallback(final Function0<Void> onDone);

    public Function1<Void,? super Object> getTaskSucceededCallback();
    public void setTaskSucceededCallback(final Function1<Void, ? super Object> onSucceeded);

    public Function1<Void,? super Throwable> getTaskFailedCallback();
    public void setTaskFailedCallback(final Function1<Void,? super Throwable> onFailure);

    public Function0<? extends Object> getTaskWork();
    public void setTaskWork(Function0<? extends Object> work);

    public Boolean isStarted();
    public void setStarted(final Boolean flag);
    public Boolean isStopped();
    public void setStopped(Boolean flag);
    public Boolean isDone();
    public void setDone(Boolean flag);
    public Boolean isFailed();
    public void setFailed(Boolean flag);
    public void setFailureCause(Object ob );
    public Boolean isSuccessful();
    public void setSuccessful(Boolean flag);
}
